#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=100005;
ll t,n,a[maxn],ans[11];
int qread(){
    int x=0,f=1,c=getchar();
    for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^48);
    return x*f;
}
int main(){
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    t=qread();
    memset(ans,0,sizeof(ans));
    for(int i=1;i<=t;i++){
        n=qread();
        for(int j=1;j<=n;j++){
            a[j]=qread();
            ans[t]+=a[j];
        }
    }
    for(int i=1;i<=t;i++)printf("%lld",ans[i]);
    return 0;
}
